package com.linshengjian.snowball.payment;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

public interface IPaymentHandler {

    /**
     * 支付
     * @param voucher 凭证编号
     * @param amount 金额
     * @param body
     * @return
     */
    Object payment(String voucher, Double amount, String title, String body) throws Exception;

    /**
     * 退款
     * @param refund 退款凭证
     * @param payment 支付凭证
     */
    void refund(String refund, String payment, Double amount) throws Exception;

    /**
     * 刷新订单状态（到第三方查询是否支付完成）
     * @param voucher
     */
    void refresh(String voucher);

    /**
     * 回调信息处理
     * @return 返回支付凭证
     */
    String callback(HttpServletRequest request, HttpServletResponse response);
}
